package org.manon.json.custom;

import java.util.ArrayList;
import java.util.List;

import org.manon.json.annotation.JSon;
import org.manon.json.annotation.JSonSerializer;

@JSon
public class CustomCollectionParent {

	private String _name;
	
	private List<CustomCollectionChild> _childs;

	public String getName() {
		return _name;
	}

	public void setName(String name) {
		_name = name;
	}

	@JSonSerializer(impl = CustomCollectionChildSerializer.class)
	public List<CustomCollectionChild> getChilds() {
		return _childs;
	}

	public void setChilds(List<CustomCollectionChild> childs) {
		_childs = childs;
	}

	public void addChild(CustomCollectionChild child) {
		if (_childs == null) {
			_childs = new ArrayList<CustomCollectionChild>();
		}
		_childs.add(child);
	}
	
}